﻿@model Pro260Website.Models.ListingViewModel<Domain.Entity.Game>
@{
    ViewBag.Title = "Top Rated Games";
}

<div id="formBackground">

<h2 class="title @Html.GetColor(Request.Cookies["color"])">Top Rated Games</h2>

<div>

    <div id="titlelessItem">
        <div class = "item">
            @using (Html.BeginForm("TopRatedGames", "Game"))
            {
                if (ViewBag.Years != null)
                {
                    @:Year
                    <select name="year">
                        @foreach (var year in ViewBag.Years)
                        {
                            <option>@year</option>
                        }
                    </select>
                }

                if(ViewBag.Genres != null)
                {
                    @:Genre
                    <select name="genre">
                        <option>any</option>
                        @foreach (var genre in ViewBag.Genres)
                        {
                            <option>@genre</option>
                        }
                    </select>
                }
        
                <input type="submit" value="Update" class="actionButtons @Html.GetColor(Request.Cookies["color"])" />
            }


            @using (Html.BeginForm("TopRatedGames", "Game"))
            {
                <input type="submit" value="Reset" class="actionButtons @Html.GetColor(Request.Cookies["color"])"/>
            }
        </div>
    </div>

</div>

@foreach (var game in @Model.Items)
{
    
    Html.RenderPartial("GameSummary", game); <br/>
}

@Html.ActionLink("Go Back to All Games", "List")

</div>
